<?php 
/**
 *	cookie类
 *
 * @package com
 * @subpackage eefocus
 * @copyright (c) 2006 - 2007 与非网 (www.eefocus.com)
 * @author	kokko<kokko313@gmail.com>
 * @version 1.0
 */
class Cookie
{
	/**
	*	构造函数
	*/
	function __construct(){
	}//end function

	/**
	*	构造函数
	*/
	function cookie(){
		$this->__construct();
	}//end function
	
	/**
	*	判断Cookie是否存在
	*	@param $name
	*/
	function is_set($name) {
		return isset( $_COOKIE[$name] );
	}//end function

	/**
	*	获取某个Cookie值
	*	@param $name
	*/
	public static function get($name) {
		return $_COOKIE[$name];
	}//end function

	/**
	*	设置某个Cookie值
	*	@param $name
	*	@param $value
	*	@param $timeout
	*/
	function set( $name,$value,$timeout='' ) {
		setcookie( $name, $value,$timeout);
		$_COOKIE[$name]	=	$value;
	}//end function

	/**
	*	删除某个Cookie值
	*	@param $name
	*/
	function delete($name) {
		setcookie( $name, "", time() - 3600);
		unset( $_COOKIE[$name] );
	}//end function
	
	/**
	*	清空Cookie值
	*/
	function clear() {
		unset( $_COOKIE );
	}//end function
}//end class
?>